X-Git-Url: https://git.r.bdr.sh/rbdr/super-polarity/blobdiff_plain/38c7d3f9eb7d63937c6654ff5dd6046ce02dd59c..74c155708d85abfc2cf227c08de4f27003015b3f:/Super%20Polarity/ScreenManager.cs diff --git a/Super Polarity/ScreenManager.cs b/Super Polarity/ScreenManager.cs new file mode 100644 index 0000000..04c10a4 --- /dev/null +++ b/Super Polarity/ScreenManager.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace SuperPolarity +{ + static class ScreenManager + { + static Stack Screens; + static SuperPolarity Game; + + static ScreenManager() + { + Screens = new Stack(); + } + + static public void Push(Screen screen) + { + Screens.Push(screen); + } + + static public void Pop() + { + Screens.Pop(); + } + + static public void Update(GameTime gameTime) + { + Screens.Peek().Update(gameTime); + } + + static public void Draw(SpriteBatch spriteBatch) + { + foreach (Screen screen in Screens) + { + screen.Draw(spriteBatch); + } + } + + internal static void SetGame(SuperPolarity game) + { + Game = game; + } + } +}